/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.purpose.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.koron.purpose.domain.JobsDutiesTraining;


public interface JobsDutiesTrainingMapper {
	
	@Delete("delete from jobs_duties_training where duties_id=#{id}")
	int delete(@Param("id") String dutiesId);
	
	@Insert("<script>"
			+ "insert into jobs_duties_training(id,training_type_id,training_type_label,cycle_id,cycle_label,duration,duties_id,istemplate) values"
			+ "<foreach collection ='beanList' item='item' index='index' separator =','>"
			+ "(#{item.id},#{item.trainingTypeId},#{item.trainingTypeLabel},#{item.cycleId},#{item.cycleLabel},#{item.duration},#{item.dutiesId},#{item.istemplate}) "
			+ "</foreach>"
			+ "</script>")
	int batchInsert(@Param("beanList") List<JobsDutiesTraining> list);
	
	@Select("select * from jobs_duties_training where duties_id=#{id}")
	List<JobsDutiesTraining> queryByTid(@Param("id") String dutiesId);
}
